@include('Home.head')
<style>
    .wrapper {
        width: 100%;
        background-color: #fff;
        margin: 0 auto;
        color: #333;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-radius: 5px;
    }
    .wrapper h3 {
        font-size: 14px;
        display: flex;
        height: 40px;
    }
    .wrapper h3 .left {
        width: 60px;
        display: block;
        text-align: right;
        margin-right: 20px;
        color: gray;
    }
    .wrapper h3 .right {
        width: 240px;
        display: block;
    }
    .wrapper h4 {
        padding:6px 0;
        font-size: 16px;
        text-align: center;
        font-weight: bold;
    }
</style>
<body>
<div class="container" id="app">
    @include('Home.member.header')
    <div class="my-nav-bar">
        <ol class="am-breadcrumb">
            <li><a href="#">首页</a></li>
            <li><a href="#">区域代理分红详情</a></li>
        </ol>
    </div>
    <div class="am-cf cart-panel con-wra">
        <div class="wrapper">
            <div>
                <h4>详情</h4>
                <h3><span class="left">交易类型:</span><span class="right">@{{ db.explain }}</span></h3>
                <h3><span class="left">金额:</span><span class="right">@{{ db.money }}</span></h3>
                <h3><span class="left">订单号码:</span><span class="right">@{{ db.ordersn }}</span></h3>
                <h3><span class="left">创建时间:</span><span class="right">@{{ db.created_at }}</span></h3>
                <h3><span class="left">交易类型:</span><span class="right">@{{ type[db.type] }}</span></h3>
                <h3><span class="left">备注:</span><span class="right">@{{ db.remark }}</span></h3>
            </div>
        </div>
    </div>
    @include('Home.foot')
</div>
</body>
<script>
    var app = new Vue({
        el: "#app",
        data: {
            title: '我的资料',
            db:'',
            type:{
                1:'订单',
                2:'转账',
                3:'体现',
                4:'充值',
                5:'奖励制度'
            }
        },
        methods: {
            //初始化 系统管理员列表
            initialize: function () {
                var id = this.getUrlParam('id')
                $.post("/home/agentBonus/getAgentBonus", {'_token': '{{csrf_token()}}', 'class': 'detail',id:id}, function (res) {
                    if (res.code) {
                        app.db = res.data
                    } else {
                        layer.msg(res.data);
                    }
                });
            },
            getUrlParam: function (name) {
                var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)')
                var result = window.location.search.substr(1).match(reg)
                return result ? decodeURIComponent(result[2]) : null
            },
        },
        //自动执行
        mounted: function () {
            this.initialize();
        },
    })
</script>
</html>
